package easy;

public class Solution_1886 {

    public boolean findRotation(int[][] mat, int[][] target) {
        boolean flag_0 = false, flag_90 = false, flag_180 = false, flag_270 = false;
        int n = mat.length;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (!flag_0 && mat[i][j] != target[i][j]) {
                    flag_0 = true;
                }
                if (!flag_90 && mat[i][j] != target[j][n - i - 1]) {
                    flag_90 = true;
                }
                if (!flag_180 && mat[i][j] != target[n - i - 1][n - j - 1]) {
                    flag_180 = true;
                }
                if (!flag_270 && mat[i][j] != target[n - j - 1][i]) {
                    flag_270 = true;
                }
            }
        }
        return !(flag_0 && flag_90 && flag_180 && flag_270);
    }

    public static void main(String[] args) {
        Solution_1886 model = new Solution_1886();
        System.out.println(model
            .findRotation(new int[][]{{0, 0, 0}, {0, 1, 0}, {1, 1, 1}}, new int[][]{{1, 1, 1}, {0, 1, 0}, {0, 0, 0}}));
    }
}
